import request from '@/utils/request.js'

export const reqIsLogin = () => request.post('/common/is_login')

export const reqLogin = (data) => request.post('/common/login', data)

export const reqLogout = () => request.get('/admins/logout')

export const reqGetUsers = (data) => request.get('/users', { params: data })

export const reqGetUser = (id) => request.get('/users/' + id)

export const reqEditUser = (id, data) => request.put('/users/' + id, data)

export const reqChangeUserStatus = (id, data) => request.put('/users/status/' + id, data)

export const updateUserRechargeStatus = (data) => request.post('/users/updateUserRechargeStatus', data)

export const reqRechargeUser = (id, data) => request.put('/users/recharge/' + id, data)

export const reqDeductUser = (id, data) => request.put('/users/deduct/' + id, data)

export const requserBalances = (data) => request.get('/userBalances', { params: data })